'use strict';

module.exports = {
    up: async(queryInterface, Sequelize) => {
        const { INTEGER, STRING, DATE, ENUM } = Sequelize;
        // 创建表
        await queryInterface.createTable('counselor', {
            id: {
                type: INTEGER(20).UNSIGNED,
                primaryKey: true,
                autoIncrement: true
            },
            counselorname: {
                type: STRING(200),
                allowNull: false,
                defaultValue: '',
                comment: '咨询师姓名',
            },
            originalprice: {
                type: INTEGER,
                allowNull: false,
                defaultValue: 0,
                comment: '咨询师价格',
            },
            counselorsellstatus: {
                type: INTEGER(1),
                allowNull: false,
                defaultValue: 1,
                comment: '上架 0禁用1启用'
            },
            counselorcoverimg: {
                type: STRING(260),
                comment: '主图',
            },
            counselortype: {
                type: STRING(260),
                allowNull: false,
                comment: '咨询师类型 1个人成长 2亲密关系 3亲子关系 4情绪管理'
            },
            counselorimg: {
                type: STRING(260),
                comment: '副图',
            },
            counselorrecommend: {
                type: INTEGER(1),
                allowNull: false,
                defaultValue: 1,
                comment: '推荐 0禁用1启用'
            },
            counselordetailcontent: {
                type: STRING(10000),
                allowNull: true,
                defaultValue: '',
                comment: '咨询师详细'
            },
            created_at: DATE,
            updated_at: DATE
        });
    },

    down: async(queryInterface, Sequelize) => {
        await queryInterface.dropTable('counselor');
    }
};